package com.sporteamws;

import java.util.Random;

import android.app.Activity;
import android.graphics.Typeface;
import android.os.Bundle;
import android.view.View;
import android.widget.ProgressBar;
import android.widget.TextView;
 
public class Loading extends Activity
{
	TextView mainTitle;
	TextView TOTDtitle;
	TextView TOTDtip;
	TextView PBtext;
	
	ProgressBar PB;	
	Random Randgenerator = new Random();
	
	@Override
    public void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);
        setContentView(com.sporteamws.R.layout.loading);
        
        //setup variables
        setupVariables();
        
        //get loading information from calling activity
        GetLoadingInformation();
        
        //set tip of the day
        SetTOTD();
    }
	
	void setupVariables()
	{
		mainTitle = (TextView) findViewById(R.id.tvLSLoadingMainTitle);
		mainTitle.setTextColor(0xFF000000); 
		TOTDtitle = (TextView) findViewById(R.id.tvLSTOTDTitle);
		TOTDtitle.setTextColor(0xFF000000); 
		TOTDtip = (TextView) findViewById(R.id.tvLoadingTOTD);
		TOTDtip.setTextColor(0xFF000000);
		TOTDtip.setTextSize(14);
		PBtext = (TextView) findViewById(R.id.tvLSLoadingInfo);
		PBtext.setTextColor(0xFF000000);
		PB = (ProgressBar) findViewById(R.id.LSloadingProgressBar);
		PB.setVisibility(View.VISIBLE);
	}
	
	void GetLoadingInformation()
	{
		
	}
	
	void SetTOTD()
	{
		String[] tips = new String[] { "My grandmother started walking five miles a day when she was 60. She's 97 now and we don't know where the heck she is",
        "The only reason I would take up jogging is so that I could hear heavy breathing again", 
        "I joined a health club last year, spent about 400 bucks. Haven't lost a pound. Apparently you have to show up",
		"I have to exercise in the morning before my brain figures out what I'm doing", 
		"I don't exercise at all. If God meant us to touch our toes, he would have put them further up our body", 
		"I like long walks, especially when they are taken by people who annoy me", 
		"I have flabby thighs, but fortunately my stomach covers them", 
		"The advantage of exercising every day is that you die healthier",
		"If you are going to try cross-country skiing, start with a small country", 
		"I don't jog. It makes the ice jump right out of my glass" };
		
		int tipIndex = Randgenerator.nextInt() % 10;
		String tipStr = "#" + (tipIndex+1) + " " + tips[tipIndex];
		TOTDtip.setText(tipStr); 
	}
}
